<?php



class ActivitiesController extends AppController {

    var $name = "Activities";
    public $helpers = array('Html', 'Form');

    public function index() {
        $this->Activities->recursive=-1;
        $this->set('activities', $this->Activity->find('all'));
    }
    
    
    
     public function add(){
           if (!empty($this->request->data)) {

           if ($this->Activity->saveAll($this->request->data)) {
           $this->Session->setFlash('La actividad se ha agregado correctamente.');
           $this->redirect(array('action' => 'index'));
            } else {

            $this->Session->setFlash('el predio se no se  ha agregado.');
            $this->redirect(array('action' => 'index'));
                       }
                         }
        
                       }
    
    
}
?>
